<?php

if(!defined('_HTML_TABLE_LIST_')) {
define('_HTML_TABLE_LIST_', 1);

function flep_html_table_list_navigation(&$data, $right_column = '&nbsp;') {
?>
  <tr>
    <td>
    <b><?php
    flep_html_navigation($data);
    ?></b>
    </td>
    <td><?php echo $right_column;?></td>
  </tr>
<?php
}

function flep_html_table_list_headers(&$headers) {
?>
  <thead>
    <tr>
      <?php
      foreach($headers as $th) {
          echo "<th>".$th."</th>";
      }
      ?>
    </tr>
  </thead>
  <tfoot>
    <tr><th colspan="<?php echo count($headers)?>"></th></tr>
  </tfoot>
<?php
}

function flep_html_table_list_links($links, &$data, $class = false) {
  foreach($links as $link) {
    if(isset($link['id'])){
      $enc_id = flep_encode($data[$link['id']]);
      if(isset($link['link'])){
        $link['link'] = sprintf($link['link'], $enc_id);
      }
      if(isset($link['onclick'])){
        $link['onclick'] = sprintf($link['onclick'], $enc_id);
      }
    }
    echo '<td class="list_center">'.flep_html_links_img($link).'</td>';
  }
}

}
?>
